package cn.gcxy.service.impl;

import java.sql.Date;
import java.util.List;

import cn.gcxy.dao.AccountDao;
import cn.gcxy.dao.PetOwnerDao;
import cn.gcxy.dao.PetStoreDao;
import cn.gcxy.dao.petDao;
import cn.gcxy.dao.impl.AccountDaoImpl;
import cn.gcxy.dao.impl.BaseDao;
import cn.gcxy.dao.impl.PetDaoImple;
import cn.gcxy.dao.impl.PetOwnerDaoImpl;
import cn.gcxy.dao.impl.PetStoreDaoImpl;
import cn.gcxy.entity.Account;
import cn.gcxy.entity.PetStore;
import cn.gcxy.service.PetStoreService;

public class PetStoreServiceImpl implements PetStoreService{
	
	private petDao petDao;
	private PetOwnerDao petOwnerDao;
	private PetStoreDao petStoreDao;
	private BaseDao baseDao;
	private AccountDao accountDao;
	
	public PetStoreServiceImpl() {
		this.petDao = new PetDaoImple();
		this.petOwnerDao = new PetOwnerDaoImpl();
		this.petStoreDao = new PetStoreDaoImpl();
		this.baseDao = new BaseDao();
		this.accountDao = new AccountDaoImpl();
	}
	
	@Override
	public PetStore login(String name, String password) {
		return petStoreDao.queryPetStore(name,password);
	}

	@Override
	public boolean addPet(String NAME, String TYPERNAME, int HEALTH, int LOVE, Date BIRTHDAY, Integer OWNER_ID,
			Integer STORE_ID, double price) {
		return petDao.addPet(NAME, TYPERNAME, HEALTH, LOVE, BIRTHDAY, OWNER_ID, STORE_ID, price);
	}

	@Override
	public List<Account> queryAccount(int storeId) {
		return accountDao.queryAccount(storeId);
	}
	
}
